using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using SalesPages.DomainModel;

namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class E1EtagMap : EntityTypeConfiguration<E1Etag>
    {
        public E1EtagMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Country)
                .HasMaxLength(5);

            this.Property(t => t.Channel)
                .HasMaxLength(20);

            this.Property(t => t.Source)
                .HasMaxLength(20);

            this.Property(t => t.City)
                .HasMaxLength(20);

            this.Property(t => t.Campaign)
                .HasMaxLength(50);

            this.Property(t => t.Placement)
                .HasMaxLength(50);

            this.Property(t => t.Description)
                .HasMaxLength(50);

            this.Property(t => t.Hashcode)
                .HasMaxLength(50);

            this.Property(t => t.InsertedBy)
                .HasMaxLength(50);

            this.Property(t => t.ModifiedBy)
                .HasMaxLength(50);

            this.Property(t => t.Etag)
                .HasMaxLength(100);

            this.Property(t => t.BusinessUnit)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("E1Etag");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Country).HasColumnName("Country");
            this.Property(t => t.Channel).HasColumnName("Channel");
            this.Property(t => t.Source).HasColumnName("Source");
            this.Property(t => t.City).HasColumnName("City");
            this.Property(t => t.Campaign).HasColumnName("Campaign");
            this.Property(t => t.Placement).HasColumnName("Placement");
            this.Property(t => t.LiveDate).HasColumnName("LiveDate");
            this.Property(t => t.Description).HasColumnName("Description");
            this.Property(t => t.Hashcode).HasColumnName("Hashcode");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.InsertDate).HasColumnName("InsertDate");
            this.Property(t => t.InsertedBy).HasColumnName("InsertedBy");
            this.Property(t => t.InsertType).HasColumnName("InsertType");
            this.Property(t => t.LastModifyDate).HasColumnName("LastModifyDate");
            this.Property(t => t.ModifiedBy).HasColumnName("ModifiedBy");
            this.Property(t => t.Etag).HasColumnName("Etag");
            this.Property(t => t.BusinessUnit).HasColumnName("BusinessUnit");
        }
    }
}
